package club.framework.web.application.sys.menu.mapper;

import club.framework.web.application.sys.menu.entity.Menu;
import club.framework.web.base.entity.BasePageReqEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by 念梓  on 2017/9/5.
 * Email:sunmch@163.com
 * author: 念梓
 * des:
 */
public interface MenuMapper {

    public int save(Menu menu);

    public int update(Menu menu);

    public int deleteById(int id);

    public Menu queryObjectById(int id);

    public List<Menu> queryPage(BasePageReqEntity<Menu> basePageReqEntity);

    public int queryTotalCount(Menu menu);

    public List<Menu> loadMenuByStep(@Param("step") int step);

    /**
     * 加载目前存在的所有菜单级别
     * @return
     */
    public List<Integer> loadMenuStep();

    public String queryCodeById(int id);

    public String queryMaxCodeByParentId(@Param("parentId") int parentId);

    public List<Menu> loadMenuByParentId(@Param("parentId") int parentId);

    public int deleteMenuByCode(@Param("code") String code);

    public int queryTotalCountByParentId(@Param("parentId") int parentId);



}
